﻿/*!	@file	r_input_server.h
	@brief	入力装置
Copyright (c) 2009 Yuya Yamaguchi

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef _R_INPUT_SERVER_H_
#define _R_INPUT_SERVER_H_

#include "../rtti/r_rtti_class_base.h"
#include "../util/r_util_singleton.h"

namespace r{
	namespace input{
		class DeviceControll;
		class DeviceKeys;
		///
		/*!
		*/
		class Server : public r::rtti::ClassBase
		{
			RRTTI_REFLECTION_DECLARE
			RSINGLETONTGET_DECLARE ( Server )
		protected:
			Server() {}
			virtual ~Server() {}
		public:
			//! コントロールデバイス数の取得
			/*!
			*/
			virtual r_si32						getDeviceControllNum() const {
				return 0;
			}
			//! コントロールデバイスの取得
			/*!
			@param	index	[in]	0～有効なデバイスのインデックス(無効な場合は0番目のデバイスが帰る)
			*/
			virtual const DeviceControll*		getDeviceControll ( r_si32 index ) const {
				return NULL;
			}
			//! キーデバイスの数の取得
			/*!
			*/
			virtual r_si32						getDeviceKeysNum() const {
				return 0;
			}
			//! キーデバイスの取得
			/*!
			*/
			virtual const DeviceKeys*			getDeviceKeys ( r_si32 index ) const {
				return NULL;
			}
		public:
			//! 入力の有/無効化
			/*! 入力を無効化した場合はそのフレーム内で帰される入力状態は無入力状態になる。
			@param	enable	[in]	入力状態の有/無効
			*/
			virtual void						setActive ( r_bool enable ) {}
			//! プラットフォーム別入力の取得更新
			/*!
			*/
			virtual	void						update ( void ) {}
		protected:
			//! キー入力開始
			/*!
			*/
			virtual void						beginInput ( void ) {}
			//! キー入力終了、入力状況を基に簡単に取り出し可能なキー情報を作成
			/*!
			*/
			virtual void						endInput ( void ) {}
		protected:
		private:
		};
	}
}
#endif // _R_INPUT_SERVER_H_
